package com.cnware.capture.ui.view.navigator;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.navigator.IDescriptionProvider;

public class NavLabelProvider extends LabelProvider implements ILabelProvider,
		IDescriptionProvider {

	@Override
	public String getText(Object element) {
		if(element instanceof NavigatorItem){
			return ((NavigatorItem)element).getText();
		}
		return null;
	}
	
	@Override
	public Image getImage(Object element) {
		if(element instanceof NavigatorItem){
			return ((NavigatorItem)element).getImage();
		}
		return super.getImage(element);
	}
	
	@Override
	public String getDescription(Object anElement) {
		String name = getText(anElement);
		return "Description: " + name;
	}

}
